package com.xnyzc.lhy.resource.util.sign;

import com.xnyzc.lhy.common.component.heli.HeLiUrlContant;
import com.xnyzc.lhy.resource.util.worksheet.HeliSignUtil;
import lombok.Data;

import java.util.Date;
import java.util.UUID;

/**
 * 访问heli的公共参数
 * @author zhengxu
 */
@Data
public class CommonParam {
    private String app_id;
    private String sign;
    private Object data;
    private Long req_time;
    private String request_id;

    public CommonParam(Object data) {
        Date date = new Date();
        this.app_id = HeLiUrlContant.heLiAppId;
        this.req_time = date.getTime();
        String sig = HeliSignUtil.createSig(data);
        this.sign = sig;
        this.request_id = UUID.randomUUID().toString();
        this.data = data;
    }
}
